package com.cyjt.operation.ui;

import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.Toast;

import com.cyjt.operation.R;
import com.cyjt.operation.adapter.InspectionAreaAdapter;
import com.cyjt.operation.bean.InspectionTimeInfo;
import com.cyjt.operation.view.ActionBarLayout;

/**
 * 巡检区域的Activity
 * 
 * @author LTP
 * 
 */
public class InspectionAreaActivity extends Activity {
	private ListView inspection_area_listview;
	private List<InspectionTimeInfo> inspectionTimeInfo;
	private InspectionAreaAdapter inspectionAreaAdapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_respon_area);
		inspectionTimeInfo = (List<InspectionTimeInfo>) getIntent().getSerializableExtra("inspectionTimeInfo");
		initView();

	}

	/** 控件初始化 */
	private void initView() {
		ActionBarLayout.setTitle("巡检区域");
		inspection_area_listview = (ListView) findViewById(R.id.inspection_area_listview);
		if (inspectionTimeInfo != null || inspectionTimeInfo.size() > 0) {
			inspectionAreaAdapter = new InspectionAreaAdapter(this, R.layout.list_view_item_for_inspection_area,
					inspectionTimeInfo);
			inspection_area_listview.setAdapter(inspectionAreaAdapter);
		} else {
			Toast.makeText(this, "巡检区域为空", Toast.LENGTH_SHORT).show();
		}

	}

}
